package com.egao.xcx.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.egao.common.core.damon.constant.UserConstant;
import com.egao.common.core.damon.constant.WechatConstant;
import com.egao.common.core.web.BaseController;
import com.egao.common.core.web.JsonResult;
import com.egao.common.system.entity.User;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.web.bind.annotation.*;

import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.security.AlgorithmParameters;
import java.security.Security;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


import org.springframework.web.bind.annotation.GetMapping;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @author : Doman
 * @version ：1.0
 * @date : 2020-04-12 17:33
 */
@RestController
@RequestMapping("/api/xcx")
public class XcxtWithTokenController extends BaseController {

    /**
     *  验证小程序的token有没有过期
     */
    @PostMapping("/auth")
    public JsonResult updateMyInfo( HttpServletRequest request) {
        User a = getLoginUser();
        return JsonResult.ok("已登陆").put("user",a);
    }

}